﻿
using BCCommon;
using BCCommon.Enums;
using BCCommon.TradingEnums;
using BCData.Trading.Purchase.GoodsPurchase;
using BCDto.Sim.Admin.Admin;
using BCDto.Trading.Purchase.GoodsPurchase;
using BCEntity.Trading.Purchase.GoodsPurchase;
using BCService.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BCService.Trading.Purchase.GoodsPurchase
{
    /// <summary>
    /// 商品采购单
    /// </summary>
    public interface IGoodsPurchaseService
    {
        #region  成员方法
        /// <summary>
        /// 是否存在此记录
        /// </summary>
        /// <param name="goodsPurchaseId">商品采购单Id</param>
        bool Exists(long goodsPurchaseId);
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="goodsPurchaseNo">商品采购单编号</param>
        bool Exists(string goodsPurchaseNo);
        /// <summary>
        /// 添加商品采购单
        /// </summary>
        /// <param name="requestDto">商品采购单信息</param>
        /// <param name="adminDto"></param>
        GoodsPurchaseDto Add(GoodsPurchaseAllRequestDto requestDto, AdminDto adminDto);
        /// <summary>
        /// 更新商品采购单
        /// </summary>
        /// <param name="putDto">商品采购单信息</param>
        /// <param name="adminDto"></param>
        GoodsPurchaseDto Update(GoodsPurchasePutDto putDto, AdminDto adminDto);
        /// <summary>
        /// 删除商品采购单
        /// </summary>
        /// <param name="goodsPurchaseId">商品采购单Id</param>
        bool Delete(long goodsPurchaseId);
        /// <summary>
        /// 获取商品采购单
        /// </summary>
        /// <param name="goodsPurchaseId">商品采购单Id</param>
        GoodsPurchaseDto Get(long goodsPurchaseId);
        /// <summary>
        /// 获取商品采购单分页列表
        /// </summary>
        /// <param name="purchaseNo">采购单编号</param>
        /// <param name="purchaseInventoryStatusType">采购库存状态</param>
        /// <param name="purchaseDateType">采购日期类型</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">商品采购单每页数据条数</param>
        PageableList<GoodsPurchaseDto> Query(string purchaseNo, PurchaseInventoryStatusType? purchaseInventoryStatusType, PurchaseDateType? purchaseDateType, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        #endregion  成员方法

        /// <summary>
        /// 修改采购状态
        /// </summary>
        /// <param name="goodsPurchaseId">采购单Id</param>
        /// <param name="purchaseStatusType">采购状态</param>
        /// <returns></returns>
        bool UpdatePurchaseStatus(long goodsPurchaseId, PurchaseStatusType purchaseStatusType);
        /// <summary>
        /// 更新定金支付信息
        /// </summary>
        /// <param name="requestDto">商品采购定金支付信息</param>
        /// <returns></returns>
        GoodsPurchaseDto UpdateDepositePaymentInfo(GoodsPurchaseDepositePaymentRequestDto requestDto);
        /// <summary>
        /// 更新尾款支付信息
        /// </summary>
        /// <param name="requestDto">商品采购尾款支付信息</param>
        /// <returns></returns>
        GoodsPurchaseDto UpdateLastPaymentInfo(GoodsPurchaseLastPaymentRequestDto requestDto);
        /// <summary>
        /// 更新交付信息
        /// </summary>
        /// <param name="requestDto">商品采购交付信息</param>
        /// <param name="adminDto"></param>
        /// <returns></returns>
        GoodsPurchaseDto UpdateDeliveryInfo(GoodsPurchaseDeliveryInfoRequestDto requestDto,AdminDto adminDto);
        /// <summary>
        /// 修改暂停采购备注
        /// </summary>
        /// <param name="requestDto">商品采购单备注信息</param>
        /// <returns></returns>
        GoodsPurchaseDto UpdateSuspendRemark(GoodsPurchaseRemarkRequestDto requestDto);
        /// <summary>
        /// 修改暂停恢复采购备注
        /// </summary>
        /// <param name="requestDto">商品采购单备注信息</param>
        /// <returns></returns>
        GoodsPurchaseDto UpdateRestoreRemark(GoodsPurchaseRemarkRequestDto requestDto);
        /// <summary>
        /// 修改停止采购备注
        /// </summary>
        /// <param name="requestDto">商品采购单备注信息</param>
        /// <returns></returns>
        GoodsPurchaseDto UpdateStopRemark(GoodsPurchaseRemarkRequestDto requestDto);
    }
}